package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.User;
import com.foreknow.elmboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/UserController")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/getUserByIdByPass")
    public User getUser(String userId,String password){
        User user = userService.getUser(userId,password);
        return user;
    }

    @RequestMapping("/saveUser")
    public int insertUser(User user){
        int user1 = userService.insertUser(user);
        return user1;
    }
}
